ostree-sysroot-deploy.c: delete redundant check
authorJonathan Lebon <jlebon@redhat.com>
Thu, 13 Oct 2016 16:05:54 +0000 (12:05 -0400)
committerAtomic Bot <atomic-devel@projectatomic.io>
Fri, 14 Oct 2016 16:06:08 +0000 (16:06 +0000)
Just noticed this while inspecting the code. The deployments retrieved
by `_ostree_sysroot_list_deployment_dirs_for_os` will forcibly already
have a matching osname since it indirectly uses that same variable to
construct them. Having a check there makes it look like there may be
subtle corner cases, when there aren't.

Closes: #529
Approved by: cgwalters

src/libostree/ostree-sysroot-deploy.c

index 65173ffed41ef4823e61983a6c9e2ec7963d23ed..a14f60056fa5af0c9d0b34afd760d9158ed4326c 100644 (file)
@@ -2002,7 +2002,7 @@ allocate_deployserial (OstreeSysroot           *self,
     g_ptr_array_new_with_free_func (g_object_unref);
 
   osdir = ot_gfile_get_child_build_path (self->path, "ostree/deploy", osname, NULL);
-  
+
   if (!_ostree_sysroot_list_deployment_dirs_for_os (osdir, tmp_current_deployments,
                                                     cancellable, error))
     goto out;
@@ -2010,9 +2010,7 @@ allocate_deployserial (OstreeSysroot           *self,
   for (i = 0; i < tmp_current_deployments->len; i++)
     {
       OstreeDeployment *deployment = tmp_current_deployments->pdata[i];
-      
-      if (strcmp (ostree_deployment_get_osname (deployment), osname) != 0)
-        continue;
+
       if (strcmp (ostree_deployment_get_csum (deployment), revision) != 0)
         continue;